package com.morgan.recyclerviewdemo.adapter

import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.morgan.recyclerviewdemo.R
import com.morgan.recyclerviewdemo.entity.TextIconBean

/**
 *description：
 *<br>author：caowugao
 *<br>time：2020/7/5 0005 10:45
 */
class MainAdapter : BaseQuickAdapter<TextIconBean, BaseViewHolder> (
    R.layout.item_icon_text
){
    override fun convert(helper: BaseViewHolder, item: TextIconBean?) {
        item?.apply {
            helper.getView<ImageView>(R.id.iv_icon).setImageResource(mIconResId)
            helper.getView<TextView>(R.id.tv_text).text = mText
        }
    }
}